home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ARASAN_S.ZIP / BOOKWRIT.H < prev    next >
C/C++ Source or Header  |  1993-11-17  |  763b  |  39 lines

  1. // Copyright 1992 by Jon Dart.  All Rights Reserved.
  2.  
  3. #ifndef _BOOK_WRITER_H
  4. #define _BOOK_WRITER_H
  5.  
  6. #include "bookentr.h"
  7. #include <fstream.h>
  8.  
  9. class Book_Writer
  10. {
  11.     // provides write access to the opening book.
  12.  
  13.     public:
  14.  
  15.     Book_Writer( const byte version, const unsigned size );
  16.     // opens book file for writing, truncates any existing file
  17.         
  18.     virtual ~Book_Writer();
  19.     // closes book file
  20.         
  21.     virtual const Boolean Is_Open() const
  22.     {
  23.        return is_open;
  24.     }
  25.         
  26.     virtual Boolean Write( Book_Entry &be );
  27.     // write a book entry to the file.  Writes are sequential.
  28.         
  29.        private:
  30.            
  31.        ofstream book_file;
  32.        Boolean is_open;
  33.        unsigned my_size;
  34.        byte my_version;
  35.        unsigned index;
  36. };
  37.  
  38. #endif
  39.